package io.github.wppli.infrastructure.persistent.dao;

import io.github.wppli.domain.message.model.entity.UserMessageEntity;
import io.github.wppli.infrastructure.persistent.po.PrivateMessage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lijiaqiang@ljq1024.cc
 * @since 2025-03-04
 */
@Mapper
public interface IPrivateMessageDao extends BaseMapper<PrivateMessage> {

    List<PrivateMessage> queryUnreadMessages(PrivateMessage privateMessage);

    List<UserMessageEntity> querySenderIds(@Param("receiverId") Long receiverId);

    void updateMessagesRead(@Param("receiverId")Long receiverId, @Param("senderId")Long senderId);
}
